const fs = require("fs")

const parser = require('@babel/parser');
// const traverse = require('@babel/traverse').default;
// const types = require('@babel/types');
const generate = require('@babel/generator').default;

const base_babel_ast = require("../../tools/babel_ast_tool");

// var content = fs.readFileSync("./VVQMB.js",{encoding:"binary"});
var content = fs.readFileSync("./const_1.js",{encoding:"binary"});
const ast = parser.parse(content, { sourceType: 'module' });

base_babel_ast.unary_tool(ast);
// base_babel_ast.simplifyConstantExpressions(ast);

const new_code = generate(ast, { retainLines: true, compact: false, concise: false });

fs.writeFile('./babel_1.js', new_code, (err) => {
});